pull: Cleanly error when doing local pulls of remote-prefixed refs
authorColin Walters <walters@verbum.org>
Tue, 4 Jul 2017 10:55:51 +0000 (06:55 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Wed, 5 Jul 2017 13:37:22 +0000 (13:37 +0000)
commit3234295324fe63f488cc68632066a784d4d11f53
tree78c4c707e5cf1ff62e56154a42146e7932300807
parent1f5ce1a9f789d9c0de5d6fbdf79540bf71c5bc9b
pull: Cleanly error when doing local pulls of remote-prefixed refs

In the storage PR I was trying to do a `pull-local` of the whole
`/ostree/repo` on the system, which ended up triggering a `g_critical()`
in the collections code, since we tried to parse a remote-prefixed ref
`fedora:fedora/26/x86_64/atomic-host` as a ref.

I'm not sure offhand what our behavior in this case *should* be.  I
think git only clones local refs, but I need to check.

This corner case arises only with `pull-local`.  But in any case,
while we were previously saying this is programmer error, since it's
so easy to pass various unchecked input into the pull machinery,
make invalid refs an explicit error.

Closes: #992
Approved by: jlebon
src/libostree/ostree-repo-pull.c
tests/pull-test.sh